<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //把数组中的下标为 3 的元素移到数组的开头.
        var a=[1,2,3,4,5,6];
        for(var i=0;i<=3;i++){
            temp=a[i];
            a[i]=a[3];
            a[3]=temp;
        }
        console.log(a);

    </script>
</body>
</html>